/**
 * Copyright (C), 2019-2020, 宇信融汇
 * FileName: InnerDemo
 * Author:   666
 * Date:     2020/6/29 21:13
 * Description: 内部类
 * History:
 * <author>          <time>          <version>          <desc>
 * 666           修改时间           版本号              描述
 */
package c_007.innerclass;

/**
 * @Classname InnerDemo
 * @Description TODO
 * @Date 2020/6/29 21:13
 * @Created by 666
 */
public class InnerDemo {
    private String name;
    private int id;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void waiClassDemo() {
        InnerClass innerClass = new InnerClass();
        System.out.println("外部类访问内部类私有属性" + innerClass.getGender());
        System.out.println("外部类");

    }

    class InnerClass {
        private String gender;
        //内部类static不能修饰属性值
        // static int age;
        final static String age="10";



        public String getGender() {
            return gender;
        }

        public  void inner_f1() {
            System.out.println(name);
        }

        public void setGender(String gender) {
            this.gender = gender;
        }

        public void innerClassDemo() {
            System.out.println("内部类调用" + getId());
            System.out.println("内部类调用" + getName());
        }
    }

}
